Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: 通知の個別削除 #13399

Conversation

tai-cha
Copy link
Contributor

@tai-cha tai-cha commented Feb 19, 2024

What

通知の個別削除のエンドポイントを作成した

Why

通知を削除する手段を提供する
Resolve #13317

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added packages/frontend Client side specific issue/PR packages/backend Server side specific issue/PR packages/misskey-js labels Feb 19, 2024
Copy link

codecov bot commented Feb 19, 2024

Codecov Report

Attention: 27 lines in your changes are missing coverage. Please review.

Comparison is base (034f472) 77.46% compared to head (e37c097) 65.87%.

Files Patch % Lines
packages/backend/src/core/NotificationService.ts 20.00% 16 Missing ⚠️
...d/src/server/api/endpoints/notifications/delete.ts 76.59% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #13399       +/-   ##
============================================
- Coverage    77.46%   65.87%   -11.59%     
============================================
  Files          184      986      +802     
  Lines        24725   114701    +89976     
  Branches       463     4287     +3824     
============================================
+ Hits         19152    75559    +56407     
- Misses        5566    39110    +33544     
- Partials         7       32       +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tai-cha
Copy link
Contributor Author

tai-cha commented Feb 19, 2024

変な差分があるので消したい

Copy link
Contributor

github-actions bot commented Feb 19, 2024

このPRによるapi.jsonの差分

差分はこちら
--- base
+++ head
@@ -59173,6 +59173,163 @@
         }
       }
     },
+    "/notifications/delete": {
+      "post": {
+        "operationId": "notifications/delete",
+        "summary": "notifications/delete",
+        "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:notifications*",
+        "externalDocs": {
+          "description": "Source code",
+          "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/notifications/delete.ts"
+        },
+        "tags": [
+          "notifications"
+        ],
+        "security": [
+          {
+            "bearerAuth": []
+          }
+        ],
+        "requestBody": {
+          "required": true,
+          "content": {
+            "application/json": {
+              "schema": {
+                "type": "object",
+                "properties": {
+                  "notificationId": {
+                    "type": "string",
+                    "format": "misskey:id"
+                  }
+                },
+                "required": [
+                  "notificationId"
+                ]
+              }
+            }
+          }
+        },
+        "responses": {
+          "204": {
+            "description": "OK (without any results)"
+          },
+          "400": {
+            "description": "Client error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "NO_SUCH_NOTIFICATION": {
+                    "value": {
+                      "error": {
+                        "message": "No such notification.",
+                        "code": "NO_SUCH_NOTIFICATION",
+                        "id": "2bcf7352-eff1-4470-b5fb-97f1b0097832"
+                      }
+                    }
+                  },
+                  "INVALID_PARAM": {
+                    "value": {
+                      "error": {
+                        "message": "Invalid param.",
+                        "code": "INVALID_PARAM",
+                        "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          },
+          "401": {
+            "description": "Authentication error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "CREDENTIAL_REQUIRED": {
+                    "value": {
+                      "error": {
+                        "message": "Credential required.",
+                        "code": "CREDENTIAL_REQUIRED",
+                        "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          },
+          "403": {
+            "description": "Forbidden error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "AUTHENTICATION_FAILED": {
+                    "value": {
+                      "error": {
+                        "message": "Authentication failed. Please ensure your token is correct.",
+                        "code": "AUTHENTICATION_FAILED",
+                        "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          },
+          "418": {
+            "description": "I'm Ai",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "I_AM_AI": {
+                    "value": {
+                      "error": {
+                        "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+                        "code": "I_AM_AI",
+                        "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          },
+          "500": {
+            "description": "Internal server error",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/Error"
+                },
+                "examples": {
+                  "INTERNAL_ERROR": {
+                    "value": {
+                      "error": {
+                        "message": "Internal error occurred. Please contact us if the error persists.",
+                        "code": "INTERNAL_ERROR",
+                        "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    },
     "/notifications/mark-all-as-read": {
       "post": {
         "operationId": "notifications/mark-all-as-read",

Get diff files from Workflow Page

@tai-cha tai-cha changed the title enhance: 通知の個別削除 (主にサーバーサイドの変更) enhance: 通知の個別削除 Feb 19, 2024
@tai-cha
Copy link
Contributor Author

tai-cha commented Feb 19, 2024

MkNotifications、MkDateSeparatedListの中にMkNoteかXNotificationを持たせる実装になっており共通の実装を綺麗に持たせるのめんどいな…ってなっているがリファクタになると変更量が増えまくるのでどうしようかな(XNotificationが巨大なため)

@tai-cha
Copy link
Contributor Author

tai-cha commented Feb 20, 2024

#13317 で入れないことがほぼ確定したのでこのPRは閉じる

@tai-cha tai-cha closed this Feb 20, 2024
@tai-cha tai-cha deleted the feat/13317-notify-individual-deletion branch February 20, 2024 00:23
@tai-cha tai-cha restored the feat/13317-notify-individual-deletion branch February 20, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR packages/misskey-js
Projects
None yet
Development

Successfully merging this pull request may close these issues.

通知を削除する方法を提供して欲しい
1 participant